/**
 * 
 */
package vanhoc.android.mediakool.custom.adapter;

import java.util.ArrayList;
import java.util.List;

import vanhoc.android.medialcool.item.data.PlaylistItemData;
import vanhoc.android.medialcool.item.layout.PlaylistItemView;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

/**
 * @author Administrator
 *
 */
public class DialogPlaylistAdapter extends ArrayAdapter<PlaylistItemData> {
	private Context pcontext;
	private ArrayList<PlaylistItemData> arrListPlaylistItem;
	
	
	public DialogPlaylistAdapter(Context context, int textViewResourceId,
			List<PlaylistItemData> objects) {
		super(context, textViewResourceId, objects);
		
		this.pcontext	=	context;
		this.arrListPlaylistItem	=	(ArrayList<PlaylistItemData>) objects;
	}

	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView tv;
		tv	=	new TextView(pcontext);
		tv.setPadding(0, 5, 0, 5);
		tv.setTextColor(Color.BLACK);
		tv.setText(arrListPlaylistItem.get(position).getPlaylistTitle());
		tv.setTag(arrListPlaylistItem.get(position).getPlaylistId());
		
		return tv;
	}

}
